<template>
  <div>
  <el-button type="primary" @click="dialogFormVisible = true" class="table_btn">+ 新建</el-button>

<el-dialog title="新建管理员" :visible.sync="dialogFormVisible">
  <el-form :model="form">
    <el-form-item label="工号" :label-width="formLabelWidth">
      <el-input v-model="form.work_id" autocomplete="off"></el-input>
    </el-form-item>
    <el-form-item label="用户名" :label-width="formLabelWidth">
      <el-input v-model="form.realname" autocomplete="off"></el-input>
    </el-form-item>
    <el-form-item label="身份" :label-width="formLabelWidth">
      <el-input v-model="form.identity" autocomplete="off"></el-input>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button type="primary":plain="true" @click="dialogFormVisible = false; success_open();" >确 定</el-button>
    <el-button @click="dialogFormVisible = false">取 消</el-button>
  </div>
</el-dialog>
   <el-button type="primary" :plain="true" class="table_delbtn" @click.native.prevent="deleteRow(scope.$index, tableData)">批量删除</el-button>
  </div>
</template>

<script>
export default {
    data() {
      return {
        dialogTableVisible: false,
        dialogFormVisible: false,
        form: {
          work_id: '',
          realname: '',
          identity: '',
          date1:'',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        formLabelWidth: '120px'
      };
    },
    methods: {
          success_open() {
            this.$message({
              message: '新建成功',
              type: 'success'
            });
          }
        }
      }
</script>

<style>
.table_btn{
  float: right;
  position: relative;
  top:-35px;
  right: 100px;
}
.table_delbtn{
  float: right;
  position: relative;
  top:-35px;
  right: -50px;
}
</style>
